package com.eastjet.maintenance.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eastjet.maintenance.domain.DispositionDetails;
import com.eastjet.maintenance.mapper.DispositionDetailsMapper;
import com.eastjet.maintenance.service.DispositionDetailsService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杨博文
 * @description 针对表【disposition_details(处置明细)】的数据库操作Service实现
 * @createDate 2024-11-25 09:23:38
 */
@Service
public class DispositionDetailsServiceImpl extends ServiceImpl<DispositionDetailsMapper, DispositionDetails> implements DispositionDetailsService {

    /*
     * 新增处置明细
     */
    @Override
    public Boolean InsertDispositionDetails(List<DispositionDetails> dispositionDetails) {
        return saveBatch(dispositionDetails);
    }

    /*
     * 修改处置明细
     */
    @Override
    public Boolean UpdateDispositionDetails(List<DispositionDetails> dispositionDetails) {
        return this.updateBatchById(dispositionDetails);
    }

    /*
     * 删除处置明细
     */
    @Override
    public Boolean DeleteDispositionDetails(List<DispositionDetails> dispositionDetails) {
        return this.removeByIds(dispositionDetails);
    }

    /*
     * 根据处置单号查询处置明细
     */
    @Override
    public List<DispositionDetails> selectDispositionDetailsByDispositionId(String code) {
        return this.list(new QueryWrapper<DispositionDetails>().and(i -> i.eq("code", code).eq("tombstone", 0)));
    }
}




